<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        img{
            width: 150px;
        }
    </style>
</head>
<body>
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">
    <img src="./img/开.jpg" alt="">

    <script>
        var oImg = document.querySelectorAll("img");
        for(var i=0; i<oImg.length; i++){
            oImg[i].tag = true;
            oImg[i].index = i;
            oImg[i].onmouseover = function(){
                if(this.tag == true){
                    oImg[this.index].src = "./img/关.jpg";
                    this.tag = false;
                }else{
                    oImg[this.index].src="./img/开.jpg ";
                    this.tag = true;
                }
            }
        }
    </script>
</body>
</html>